(function (angular) {
    'use strict';
    angular.module('fs.common').factory("i18nLoader", i18nLoader);

    i18nLoader.$inject = ['$q', '$log', 'storageService', 'StorageConstants', '$translate'];
    function i18nLoader($q, $log, storageService, StorageConstants, $translate) {
        var log = $log.getInstance('i18nLoader');
        return function (options) {
            var i18nResources1 = storageService.getItemFromSession(StorageConstants.SESSION_I18N_RESOURES) || {};
            var i18nResources2 = storageService.getItemFromSession(StorageConstants.SESSION_I18N_VALIDATION_RESOURES) || {};
            return $q.resolve(angular.merge(i18nResources1, i18nResources2));
        };
    }
})(angular);